#include "../inc/SkyBox.h"

void SkyBox::setDimensions ( GLfloat w, GLfloat h, GLfloat d )
{
     Box::setDimensions( w, h, d );
     
     // Inverte as normais dos planos
     side[Box::FRONT].rotate( CoordF( 0, 180, 0 ) );
     side[Box::BACK].rotate( CoordF( 0, 180, 0 ) );
     side[Box::LEFT].rotate( CoordF( 0, 180, 0 ) );
     side[Box::RIGHT].rotate( CoordF( 0, 180, 0 ) );
     side[Box::TOP].rotate( CoordF( 180, 0, 0 ) );
     side[Box::BOTTOM].rotate( CoordF( 180, 0, 0 ) );
}

void SkyBox::setTex ( const char * tex )
{
  for (int i=0; i<6; i++)
  {
    side[i].material()->setMaterial(tex, 0.2, 0.2, 0.2);
    side[i].material()->toggleLighting();
  }
}

void SkyBox::setTex ( const char * texarray[6] )
{
  for (int i=0; i<6; i++)
  {
    side[i].material()->setMaterial(texarray[i], 0.2, 0.2, 0.2);
    side[i].material()->toggleLighting();
  }
}
